---
title: Load and cache the benefit jurisdiction code map
summary: Builds and caches the benefit-jurisdiction code map from BENEFIT_JURISDICTION_CODE.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Business.Policy
reference_type: package
operation_id: op-12-benefit-jurisdiction-code-map
trigger: Caller invokes CodeMaps.GetBenefitJurisdictionCodeMap
---

# Load and cache the benefit jurisdiction code map

Builds and caches (per-process, `Static`) the benefit-jurisdiction code map used to translate `S`/`F` codes to `State`/`Federal`.

| Field | Value |
| --- | --- |
| **Operation ID** | op-12-benefit-jurisdiction-code-map |
| **Trigger** | Caller invokes `CodeMaps.GetBenefitJurisdictionCodeMap` |
| **Inputs** | `IDataPortalInfo`, optional refresh flag |
| **Outputs** | Cached `clsBenefitJurisdictionCodeMap` |
| **Primary components** | `CodeMaps.GetBenefitJurisdictionCodeMap`, `clsBenefitJurisdictionCodeMap` |
| **Entry point** | SAIF.Business.Policy/CodeMaps/clsBenefitJurisdictionCodeMap.vb |

## Steps

1. If `refresh` is true or the `Static` cached instance is `Nothing`, construct a new map ([BR-POL-016](../business-rules.md#br-pol-016-code-map-caching)).
2. The constructor runs `select code, code_descr from BENEFIT_JURISDICTION_CODE` ([SQL-001](../sql/SQL-001-benefit-jurisdiction-code-lookup.md)) through the framework `Fill(inDPI, MySQL)` helper.
3. Iterates the `clsResultSet` rows and adds only `"S"` → `State` and `"F"` → `Federal` ([BR-POL-012](../business-rules.md#br-pol-012-benefit-jurisdiction-code-recognition)); all other codes are ignored.
4. Return the cached instance.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller invokes<br>GetBenefitJurisdictionCodeMap"]) --> A{"refresh is true or<br>cached instance is Nothing?"}
	A -->|No| End(["Return cached<br>clsBenefitJurisdictionCodeMap"])
	A -->|Yes| B["Construct new map"]
	B --> C["Run SELECT code, code_descr<br>FROM BENEFIT_JURISDICTION_CODE<br>via Fill helper"]
	C --> D["Iterate clsResultSet rows"]
	D --> E{"Code = S or F?"}
	E -->|S| F["Add State"]
	E -->|F| G["Add Federal"]
	E -->|Other| H["Ignore code"]
	F --> End
	G --> End
	H --> End
```

## Failure and edge-case behavior
- Codes other than `"S"` and `"F"` are ignored and are not added to the map ([BR-POL-012](../business-rules.md#br-pol-012-benefit-jurisdiction-code-recognition)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Business.Policy/CodeMaps/clsBenefitJurisdictionCodeMap.vb`
